<template>
	<view class="">
		<view class="top">
			<view class="left">
				<image src="../static/icon/icon-sc.png" mode=""></image>
			</view>
			<view class="right">
				点击选择房间
			</view>
		</view>
		<view class="recordList">
			<view class="recordItem" v-for="(item,index) in recordList" :key="index">
				<view class="">
					<image src="../static/icon/icon-graydot.png" mode=""></image>
				</view>
				<view class="">
					{{item.date}}
				</view>
				<view class="">
					{{item.time}}
				</view>
				看房签到
			</view>
		</view>
		<view class="signIn">
			<view class="signInArea" @click="signIn">
				看房签到
			</view>
		</view>
		<mpopup  ref="mpopup" :isdistance="true"></mpopup>  
	</view>
</template>

<script>
	import mpopup from '../components/xuan-popup/xuan-popup.vue'
	export default{
		name:'record',
		data(){
			return{
				recordList:[
					{
						date:'2019/9/16',
						time:'13:00:23',
					}
				]
			}
		},
		methods:{
			signIn(){
				
				uni.request({
					url: 'http://api.yjzufang.com/api.php/Signin/index', 
					method:'POST',
					data: {
						house_id: 11
					},
					header: {
						'content-type':'application/json',
						'token': 'bc956c13-3647-45d8-926d-73403ad1efa6' 
					},
					success: function (res) {
						console.log(res.data);
						if(res.code == 1){
							this.$refs.mpopup.open({
								type:'success',
								content:res.msg,
								timeout:2000,
							});
						}
					}
				})
			}
		},
		components:{
			mpopup
		}
	}
</script>

<style>
	.top{
		display: flex;
		
		width: 90%;
		margin: 40upx auto;
	}
	.top .left{
		width: 65upx;
		height: 65upx;
		background: #F2F6F9;
		border-radius: 50%;
	}
	.top .left image{
		width: 65upx;
		height: 65upx;
	}
	.top .right{
		margin-left: 40upx;
		line-height: 65upx;
		font-size: 30upx;
	}
	.recordList{
		width: 90%;
		margin: 50upx auto;
	}
	.recordItem{
		display: flex;
		height: 40upx;
		margin: 10upx 0;
		font-size: 30upx;
		line-height: 40upx;
	}
	.recordItem view{
		padding: 0 10upx;
	}
	.recordItem image{
		margin-top: 5upx;
		width: 30upx;
		height: 30upx;
	}
	.signIn{
		display: flex;
		justify-content: center;
		align-items: center;
		margin-top: 260upx;
		width: 100%;
		height: 260upx;
		
	}
	.signInArea{
		width: 260upx;
		height: 260upx;
		background: #FF984C;
		border-radius: 50%;
		color: #FFFFFF;
		font-size: 32upx;
		line-height: 260upx;
		text-align: center;
		box-shadow: 0 0 10px #C0C0C0;
	}
</style>
